<?php

add_filter('genesis_pre_get_option_site_layout', '__genesis_return_full_width_content');

remove_action('genesis_loop', 'genesis_do_loop');

// filtro que troca o p com class site-title para um h1 com site-title
function h1_for_site_title( $wrap ) {
  return 'h1';
}
add_filter('genesis_site_title_wrap', 'h1_for_site_title');

add_action('genesis_loop', 'meufilho_home_loop');
function meufilho_home_loop() {
  ?>

    <div class="home-top">
      <div class="sobre">
        <h2>Sobre Nós</h2>
        <?php dynamic_sidebar('sobre1'); ?>
        <?php dynamic_sidebar('sobre2'); ?>
        <?php dynamic_sidebar('sobre3'); ?>        
      </div>
    </div>
    <div class="home-middle">
      <h2>Últimos posts</h2>
      <?php
        $args = array(
          'post_type'       =>  'post',
          'posts_per_page'   =>  3
        );
        $loop = new WP_Query( $args );
        $cont = 1;

        if( $loop->have_posts() ) :
          while( $loop->have_posts() ):
            $loop->the_post();

      ?>
        <div class="<?php echo ($cont == 1) ? 'one-third first' : 'one-third'; ?>">
          <div class="miniatura"><?php the_post_thumbnail(); ?></div>
          <div class="titulo"><h3><?php the_title(); ?></h3></div>
          <div class="resumo"><?php the_excerpt(); ?></div>
          <div class="ler-mais"><a class="ler-mais" href="<?php the_permalink(); ?>">Ler mais</a></div>
        </div>



      <?php
          $cont++;
          endwhile;
          
          wp_reset_postdata();
        endif;
      

      ?>



    </div>



  <?php
}

genesis();

?>